package com.ulife.permission.common;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

public enum TagEnum {

	CALL_AND_ANSWER_VOCAL_HARMONY ("call and answer vocal harmony (antiphony)","A1"),
	PAIRED_VOCAL_HARMONY ("paired vocal harmony","A2"),
	VOCAL_HARMONIES ("vocal harmonies","A3"),
	ELECTRONICA_INFLUENCES ("electronica influences","A4"),
	R_B_INFLUENCES ("r & b influences","A5"),
	PUNK_INFLUENCES ("punk influences","A6"),
	REGGAE_INFLUENCES ("reggae influences","A7"),
	GOSPEL_INFLUENCES ("gospel influences","A8"),
	DISCO_INFLUENCES ("disco influences","A9"),
	COUNTRY_INFLUENCES ("country influences","A10"),
	LATIN_INFLUENCES ("latin influences","A11"),
	BLUEGRASS_INFLUENCES ("bluegrass influences","A12"),
	DOWNTEMPO_INFLUENCES ("downtempo influences","A13"),
	JAZZ_INFLUENCES ("jazz influences","A14"),
	ROCK_ROLL_INFLUENCES ("rock & roll influences","A15"),
	BLUES_INFLUENCES ("blues influences","A16"),
	RNB_INFLUENCES ("r'n'b influences","A17"),
	MIXED_ACOUSTIC_AND_ELECTRIC_INSTRUMENTATION ("mixed acoustic and electric instrumentation.","A18"),
	ACOUSTIC_ROCK_INSTRUMENTATION ("acoustic rock instrumentation","A19"),
	MELLOW_ROCK_INSTRUMENTATION ("mellow rock instrumentation","A20"),
	ELECTRIC_ROCK_INSTRUMENTATION ("electric rock instrumentation","A21"),
	HEAVY_MELODIC_ORNAMENTATION ("heavy melodic ornamentation","A22"),
	INTRICATE_MELODIC_PHRASING ("intricate melodic phrasing","A23"),
	REPETITIVE_MELODIC_PHRASING ("repetitive melodic phrasing","A24"),
	ROMANTIC_LYRICS ("romantic lyrics","A24"),
	GREAT_LYRICS ("great lyrics","A26"),
	POP_ROCK_QUALITIES ("pop rock qualities","A27"),
	CLASSIC_SOUL_QUALITIES ("classic soul qualities","A28"),
	HARD_ROCK_ROOTS ("hard rock roots","A29"),
	PUNK_ROOTS ("punk roots","A30"),
	ROCK_ROLL_ROOTS ("rock & roll roots","A31"),
	ELECTRONICA_ROOTS ("electronica roots","A32"),
	FOLK_ROOTS ("folk roots","A33"),
	ACOUSTIC_SONORITY ("acoustic sonority","A34"),
	SYNTHETIC_SONORITY ("synthetic sonority","A35"),
	MILD_RHYTHMIC_SYNCOPATION ("mild rhythmic syncopation","A36"),
	MAJOR_KEY_TONALITY ("major key tonality","A37"),
	MINOR_KEY_TONALITY ("minor key tonality","A38"),
	MIXED_MINOR_MAJOR_KEY_TONALITY ("mixed minor & major key tonality","A39"),
	A_DYNAMIC_MALE_VOCALIST ("a dynamic male vocalist","A40"),
	AN_EMOTIONAL_MALE_LEAD_VOCAL_PERFORMANCE ("an emotional male lead vocal performance","A41"),
	A_LAID_BACK_FEMALE_VOCAL ("a laid back female vocal","A42"),
	A_BREATHY_MALE_LEAD_VOCALIST ("a breathy male lead vocalist","A43"),
	A_SUBTLE_USE_OF_VOCAL_HARMONY ("a subtle use of vocal harmony","A44"),
	HEAVY_USE_OF_VOCAL_HARMONIES ("heavy use of vocal harmonies","A45"),
	INTERWEAVING_VOCAL_HARMONY ("interweaving vocal harmony","A46"),
	A_TWELVE_EIGHT_TIME_SIGNATURE ("a twelve-eight time signature","A47"),
	DANCEABLE_BEATS ("danceable beats","A48"),
	SHUFFLE_BEATS ("shuffle beats","A49"),
	ACOUSTIC_RHYTHM_PIANO ("acoustic rhythm piano","A50"),
	HEAVY_ELECTRIC_RHYTHM_GUITARS ("heavy electric rhythm guitars","A51"),
	A_PROMINENT_RHYTHM_PIANO_PART ("a prominent rhythm piano part","A52"),
	ELECTRIC_GUITAR_RIFFS ("electric guitar riffs","A53"),
	A_GOOD_DOSE_OF_ACOUSTIC_GUITAR_PICKIN ("a good dose of acoustic guitar pickin'","A54"),
	STRING_SECTION_BEDS ("string section beds","A55"),
	ELECTRIC_RHYTHM_GUITARS ("electric rhythm guitars","A56"),
	ELECTRIC_GUITAR_WALL_O_SOUND ("electric guitar wall-o-sound","A57"),
	AN_ELECTRIC_GUITAR_SOLO ("an electric guitar solo","A58"),
	ELECTRIC_PIANOS ("electric pianos","A59"),
	ELECTRIC_GUITAR_EFFECTS ("electric guitar effects","A60"),
	A_BUSY_HORN_SECTION ("a busy horn section","A61"),
	ACOUSTIC_RHYTHM_GUITARS ("acoustic rhythm guitars","A62"),
	A_VOCAL_CENTRIC_AESTHETIC ("a vocal-centric aesthetic","A63"),
	A_CLEAR_FOCUS_ON_RECORDING_STUDIO_PRODUCTION ("a clear focus on recording studio production","A64"),
	EXTENSIVE_VAMPING ("extensive vamping","X1"),
	USE_OF_A_STRING_ENSEMBLE ("use of a string ensemble","X2"),
	THRU_COMPOSED_MELODIC_STYLE ("thru composed melodic style","X3"),
	COUNTRY_ROCK_LEANINGS ("country rock leanings","X4"),
	DANCEABLE_GROOVES ("danceable grooves","X5"),
	MODERN_RB_STYLINGS ("modern r&b stylings","X6"),
	MELODIC_SONGWRITING ("melodic songwriting","X7"),
	BASIC_ROCK_SONG_STRUCTURES ("basic rock song structures","X8"),
	FOLK_INFLUENCES ("folk influences","X9"),
	DEMANDING_INSTRUMENTAL_PART_WRITING ("demanding instrumental part writing","X10"),
	A_SUBTLE_USE_OF_VOCAL_COUNTERPOINT ("a subtle use of vocal counterpoint","X11"),
//	MODERN_RB_STYLINGS ("modern r&b stylings","X12"),
	DEMANDING_VOCAL_PERFORMANCES ("demanding vocal performances","X13"),
	PROMINENT_PERCUSSION ("prominent percussion","X14"),
	ORCHESTRAL_ARRANGING ("orchestral arranging","X15"),
	MANY_OTHER_SIMILARITIES_IDENTIFIED_IN_THE_MUSIC_GENOME_PROJECT ("many other similarities identified in the music genome project.","X16"),
	SYNTH_ROCK_ARRANGING ("synth rock arranging","X17"),
	A_KID_FRIENDLY_VIBE ("a kid-friendly vibe","X18"),
	STRAIGHT_DRUM_BEATS ("straight drum beats","X19"),
	GROOVE_BASED_COMPOSITION ("groove based composition","X20"),
	UNSYNCOPATED_ENSEMBLE_RHYTHMS ("unsyncopated ensemble rhythms","X21"),
	BACKGROUND_STRING_SECTION ("background string section","X22"),
	LIGHT_DRUMMING ("light drumming","X23");
	
	
	private String name;
	
	private String tag;

	public String getName() {
		return name;
	}

	public String getTag() {
		return tag;
	}

	private TagEnum(String name, String tag) {
		this.name = name;
		this.tag = tag;
	}
	
	public static String getTag(String description) {
		String[] descs = StringUtils.split(description, ",");
		Map<String, String> tagMap = new HashMap<String, String>();
		if (descs != null) {
			for (String desc : descs) {
				for (TagEnum t : TagEnum.values()) {
					if (StringUtils.equals(StringUtils.trim(desc), t.getName())){
						tagMap.put(t.getTag(), "1");
					}
				}
			}
		}
		StringBuffer buffer = new StringBuffer();
		for (String t : tagMap.keySet()) {
			buffer.append(t).append(";");
		}
		return buffer.toString();
	}
	

	public static void main(String[] str) {
		String a = "";
		Map<String, String> tagMap = new HashMap<String, String>();
		for (TagEnum t : TagEnum.values()) {
			if (a.contains(t.getName())) {
				tagMap.put(t.getTag(), "1");
			}
		}
		String tag = "";
		for (String t : tagMap.keySet()) {
			tag = tag + t;
		}
		System.out.print(tag);
	}
}
